#include "StdAfx.h"
#include "TestPayload.h"

namespace CO { namespace SpiFoundation { namespace ErrorHandling {

TestPayload::TestPayload(double value) :
	//
	// TODO:  Initialize attributes.
	//
	value_(value)
{
}

TestPayload::~TestPayload(void)
{
}

double TestPayload::value(void)
{
	return value_;
}

bool TestPayload::isSafe(void) const
{
	//
	// TODO:  If you have any IPayload derived attributes, 
	//		return (myAttribute1.isSafe() && myAttribute2.isSafe());
	//
	return true;	// No pointer attributes.
}

SpiFoundation::RoomFW::PayloadTypeId TestPayload::getTypeID() const
{
	//
	// TODO:  Return a unique id for your payload.
	//
	return TEST_PAYLOAD_TYPE_ID;
}

std::string TestPayload::toString(void) const
{
	//
	// TODO:  Format your attributes in an easy to read format for debugging.
	//
	std::stringstream ostr;
	ostr << "TestPayload: value=" << value_;
	return ostr.str();
}

void TestPayload::serialize(SpiFoundation::RoomFW::oarchive& ar, const unsigned int /*version*/) const
{
	//
	// TODO:  Serialize your attributes.
	//
	//
	// Note:  This is only used for binding over TCP/IP.
	//
	ar << value_;
}

void TestPayload::serialize(SpiFoundation::RoomFW::iarchive& ar, const unsigned int /*version*/)
{
	//
	// TODO:  Serialize your attributes.
	//
	//
	// Note:  This is only used for binding over TCP/IP.
	//
	ar >> value_;
}

}}} // End namespace
